package com.heyqing.topic.ReadBinaryWatch_0401;

import java.util.ArrayList;
import java.util.List;

/**
 * ClassName:ReadBinaryWatch
 * Package:com.heyqing.topic.ReadBinaryWatch_0401
 * Description:
 *
 * @Date:2024/9/28
 * @Author:Heyqing
 */
public class ReadBinaryWatch {
    public List<String> readBinaryWatch(int turnedOn) {
        List<String> ans = new ArrayList<String>();
        for (int i = 0; i < 1024; ++i) {
            int h = i >> 6, m = i & 63;
            if (h < 12 && m < 60 && Integer.bitCount(i) == turnedOn) {
                ans.add(h + ":" + (m < 10 ? "0" : "") + m);
            }
        }
        return ans;
    }
}
